import type { SupplementaryPickupRecordVO, SupplementaryPickupRecordForm, SupplementaryPickupRecordQuery } from './model';

import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';

import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';

/**
* 查询补充提货记录列表
* @param params
* @returns 补充提货记录列表
*/
export function supplementaryPickupRecordList(params?: SupplementaryPickupRecordQuery) {
  return requestClient.get<PageResult<SupplementaryPickupRecordVO>>('/hm/supplementaryPickupRecord/list', { params });
}

/**
 * 导出补充提货记录列表
 * @param params
 * @returns 补充提货记录列表
 */
export function supplementaryPickupRecordExport(params?: SupplementaryPickupRecordQuery) {
  return commonExport('/hm/supplementaryPickupRecord/export', params ?? {});
}

/**
 * 查询补充提货记录详情
 * @param supplementaryPickupId id
 * @returns 补充提货记录详情
 */
export function supplementaryPickupRecordInfo(supplementaryPickupId: ID) {
  return requestClient.get<SupplementaryPickupRecordVO>(`/hm/supplementaryPickupRecord/${supplementaryPickupId}`);
}

/**
 * 新增补充提货记录
 * @param data
 * @returns void
 */
export function supplementaryPickupRecordAdd(data: SupplementaryPickupRecordForm) {
  return requestClient.postWithMsg<void>('/hm/supplementaryPickupRecord', data);
}

/**
 * 更新补充提货记录
 * @param data
 * @returns void
 */
export function supplementaryPickupRecordUpdate(data: SupplementaryPickupRecordForm) {
  return requestClient.putWithMsg<void>('/hm/supplementaryPickupRecord', data);
}

/**
 * 删除补充提货记录
 * @param supplementaryPickupId id
 * @returns void
 */
export function supplementaryPickupRecordRemove(supplementaryPickupId: ID | IDS) {
  return requestClient.deleteWithMsg<void>(`/hm/supplementaryPickupRecord/${supplementaryPickupId}`);
}
